<#assign title="summary">
<#include "content_head.ftl">

<section class="vbox">
  <section class="scrollable wrapper">
    <form id="theform" name="theform">

      <input type='hidden' id='qtype' name='qtype' value='${qtype!''}' />
      <input type='hidden' id='belong' name='belong' value='${belong!''}' />
      <input type='hidden' id='ext_site' name='ext_site' value='${ext_site!''}' />
      <input type='hidden' id='search_engin' name='search_engin' value='${search_engin!''}' />
      <input type='hidden' id='search_keyword' name='search_keyword' value='${search_keyword!''}' />

      <section class="panel panel-default">
        <header class="panel-heading" name="desc" id="desc">
          <strong>搜索条件</strong>
        </header>
        <div class="panel-body">

          <div class="col-xs-12 col-sm-6 col-md-3 form-group">
            <div class="input-group">
              <label class="input-group-addon" for="TimeDay">日期</label>
              <input name="TimeDay" id="TimeDay" class="form-control" type="text" value="${TimeDay!''}" />
            </div>
          </div><!-- col -->

        </div><!-- panel-body -->
        <footer class="panel-footer bg-light lter">
          <button id="theform_commit" type="button" class="btn btn-success btn-s-xs">查询</button>
        </footer>
      </section>

      <section class="panel panel-default">
        <header id="gheader" class="panel-heading font-bold">汇总</header>
        <table id="summarytable" data-show-export:"true">
        <thead>
        <tr>
          <th data-field="requestCount"     data-formatter="numt">请求数</th>
          <th data-field="esCount"          data-formatter="numt">ES查询数</th>
          <th data-field="rdsCount"         data-formatter="numt">REDIS查询数</th>
          <th data-field="jdbcExecuteCount" data-formatter="numt">JDBC执行数</th>
          <th data-field="concurrentMax"    data-formatter="numt">最高并发</th>
            <th data-field="esResTotal" data-formatter="numt">ES输出(字节)</th>
            <th data-field="rdsResTotal" data-formatter="numt">REDIS输出(字节)</th>
        </tr>
        </thead>
        </table>
      </section>
      <section class="panel panel-default">
          <header id="gheader" class="panel-heading font-bold">直方图</header>
        <div class="row wrapper">
          <div class="col-xs-6 col-sm-6 col-md-6 form-group">
              <select id="histogramPrefix" name="histogramPrefix" class="form-control">
                  <option value="txh">连接挂起</option>
                  <option value="txn">事务执行时间</option>
                  <option value="rds_c">rds耗时</option>
                  <option value="rds_s">rds结果大小</option>
                  <option value="es_c">es查询耗时</option>
                  <option value="es_r">es请求大小</option>
                  <option value="es_s">es结果大小</option>
                  <option value="cost">请求耗时</option>
            </select>
          </div>
        </div><!-- row -->
          <div id="histogramChart" style="display: block; height: 300px; width: auto; "></div>
      </section>

      <section class="panel panel-default">
        <header id="theader" class="panel-heading font-bold">表格</header>
        <table id="thetable" data-show-export:"true"></table>
      </section>

    </form>
  </section>
</section>
<a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen,open" data-target="#nav,html"></a>

<#include "content_foot.ftl">

<script type="text/javascript">
  var currentData;

  <#--function switchTable(){-->
    <#--groupby = $("input[name='groupby']:checked").val();-->
    <#--initTable();-->

    <#--return;-->
    <#--if (groupby == 'TimeHour'){-->
      <#--initTable();-->

    <#--} else if (groupby == 'TimeDay' || groupby == 'TimeWeek' || groupby == 'TimeMonth'){-->
      <#--initTable();-->

    <#--} else {-->
      <#--alert('找不到聚合方法:'+groupby);-->
    <#--}-->
  <#--}-->

  <#--$(document).ready(function () {-->
    <#--$("input[name='groupby']").change(function() {-->
      <#--switchTable();-->
    <#--});-->

    <#--$('#theform_commit').click(function (){-->
      <#--switchTable();-->
    <#--});-->

    <#--$("#GraphiIndex").change(function() {-->
      <#--//redrawChart($(this).val());-->
    <#--});-->

    <#--initDateRangePick($('#TimeDay'));-->

    <#--$('#summarytable').bootstrapTable({-->
      <#--data: [{-->
      <#--}]-->
    <#--});-->

    <#--initTable();-->
  <#--});-->

</script>
<script src="/static/js/summary.js"></script>
